VERSION 5.00
Begin VB.Form frmDir 
   Caption         =   "Select Path"
   ClientHeight    =   4272
   ClientLeft      =   60
   ClientTop       =   408
   ClientWidth     =   5052
   LinkTopic       =   "Form1"
   ScaleHeight     =   4272
   ScaleWidth      =   5052
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "&Cancel"
      Height          =   465
      Left            =   3825
      TabIndex        =   8
      Top             =   3675
      Width           =   930
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "&OK"
      Default         =   -1  'True
      Height          =   480
      Left            =   2640
      TabIndex        =   7
      Top             =   3705
      Width           =   915
   End
   Begin VB.DirListBox Dir1 
      Height          =   2115
      Left            =   1185
      TabIndex        =   1
      Top             =   780
      Width           =   3375
   End
   Begin VB.DriveListBox Drive1 
      Height          =   315
      Left            =   1230
      TabIndex        =   0
      Top             =   330
      Width           =   3330
   End
   Begin VB.PictureBox Picture1 
      Height          =   3450
      Left            =   120
      ScaleHeight     =   3408
      ScaleWidth      =   4644
      TabIndex        =   2
      Top             =   90
      Width           =   4695
      Begin VB.TextBox txtPath 
         Enabled         =   0   'False
         Height          =   285
         Left            =   1050
         TabIndex        =   5
         Top             =   2895
         Width           =   3345
      End
      Begin VB.Label Label3 
         Caption         =   "Path:"
         Height          =   225
         Left            =   150
         TabIndex        =   6
         Top             =   2925
         Width           =   600
      End
      Begin VB.Label Label2 
         Caption         =   "Directory:"
         Height          =   240
         Left            =   150
         TabIndex        =   4
         Top             =   660
         Width           =   765
      End
      Begin VB.Label Label1 
         Caption         =   "Drive:"
         Height          =   240
         Left            =   150
         TabIndex        =   3
         Top             =   255
         Width           =   615
      End
   End
End
Attribute VB_Name = "frmDir"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdCancel_Click()
    frmDirType.txtDir.Text = ""
    Unload Me
End Sub

Private Sub cmdOK_Click()
    frmDirType.txtDir.Text = txtPath.Text
    Unload Me
End Sub

Private Sub Dir1_Change()
    txtPath.Text = Dir1.Path
End Sub

Private Sub Drive1_Change()

    Dim iPos As Integer
    'Dim strDrive As String

    On Error GoTo Drive1_ChangeFix

    txtPath.Text = Drive1.Drive & "\"
    'mapped drives: p: [\\LIB_SOD_01\UDD]
    iPos = InStr(1, Drive1.Drive, "[")
    If iPos > 0 Then
        Dir1.Path = Left(Drive1.Drive, iPos - 2) & "\"
    Else
        Dir1.Path = Drive1.Drive & "\"
    End If
    Exit Sub
    
Drive1_ChangeFix:
    If Err.Number = 68 Then
        MsgBox Drive1.Drive & "\ is not available.", vbExclamation, "Directory Clean Up"
    Else
        MsgBox "Drive1_Change: " & Err.Number & " - " & Err.Description, vbExclamation, "Directory Clean Up"
    End If
End Sub
